//
// Created by pzw on 24-3-12.
//

#ifndef QTTEST_MODIFYSEQ_H
#define QTTEST_MODIFYSEQ_H

#include <algorithm>
#include <utility>
#include <vector>
#include <list>
#include <iostream>
#include <fstream>
#include <iterator>
#include <cctype>
#include <array>
#include <random>
#include <functional>

class Club;

class Rand_int;

typedef Rand_int Urand; // using Urand = Rand_int;

class ModifySeq {
public:
    explicit ModifySeq() = default;
    ~ModifySeq() = default;

public:
    static void std_transform_toupper(std::string &text);
    static void std_copy_stream(std::list<Club> &lc, std::ostream &os);
    static void std_copy_vec(const std::vector<char> &vs, std::vector<char> &v);
    static void std_unique_vec(std::list<char> &ls, std::vector<char> &vs);
    template<typename Container>
    static void std_unique_erase_vec(Container &cn);
    template<typename Tp>
    static void std_remove_vec(Tp &cn);
    static void std_next_permutation_vec(std::vector<char> &vs);
    static void std_fill_vec(std::array<int, 900> v2, std::vector<int> &v3);
    static void std_swap_vec(std::vector<int> &vs, int *ptr);
};

class Club : public std::error_code {
private:
    std::string clubName;
public:
    explicit Club(const char *name) : clubName(name) {};
    ~Club() = default;
};

class Rand_int {
private:
    std::uniform_int_distribution<>::param_type param_type;
    std::function<int()> r = bind(std::uniform_int_distribution<>{param_type}, std::default_random_engine{});

public:
    explicit Rand_int() = default;

    explicit Rand_int(int lo, int hi) : param_type{lo, hi} {
    }

    explicit Rand_int(int hi) : param_type{0, hi} {
    }

    int operator()() const {
        return r();
    }
};

int ModifySeq_main();

#endif //QTTEST_MODIFYSEQ_H
